<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel='stylesheet' href="app.css">
</head>

<body>
    <div class="container">
        <div class="rocket">
            <img src="resizeApi.png" class="img">
        </div>
    </div>

    <script>
        function rand(m, n) {
            return Math.ceil(Math.random() * (n - m + 1)) + m - 1;
        }
        //光线总数
        let num = 40;
        for (let i = 0; i < num; i++) {
            //创建i元素
            const i = document.createElement('i');
            //设置样式
            i.style.height = rand(30, 100) + 'px';
            i.style.left = rand(1, 99) + 'vw';
            //随机动画周期
            i.style.animationDuration = rand(5, 30) / 10 + 's';
            //将i插入到container中
            document.querySelector('.container').appendChild(i);
        }
    </script>
</body>

</html>